//
//  SqlController.h


#import <Foundation/Foundation.h>
#import "FMDB.h"

typedef enum {
    CPEqual = 0,
    CPLessthan,
    CPGreaterthan,
    CPError,
} CPDate;

@interface QKSqlManger : NSObject

//创建数据库
+ (void)createDB;

//创建数据表
+ (void)creatTable:(NSString *)tableName
         tableKeys:(NSArray  *)keys;

//插入一组数据
+ (void)insertTable:(NSString   *)tableName
         groupValue:(NSArray    *)values
         primaryKey:(NSString   *)key;

//查找一组数据
+ (NSMutableArray *)selectTable:(NSString *)tableName
                      tableKeys:(NSArray  *)keys
                          where:(NSString *)where;

//一条一条的查找数据
+ (void)selectTable:(NSString *)tableName
          tableKeys:(NSArray  *)keys
              where:(NSString *)where
            success:(void (^)(NSDictionary *dic))sucess
            failure:(void (^)(NSString   *error))failure;

//查找一组数据
+ (void )selGroupData:(NSString *)tableName
            tableKeys:(NSArray  *)keys
                where:(NSString *)where
             susscess:(void (^)(NSArray *result))sussess
              failure:(void (^)(NSString *error))failure;



+ (void)updateTable:(NSString   *)tableName
         groupValue:(NSArray    *)values
            success:(void(^)())success
            failure:(void(^)())failure;
@end
